//
//  SHRWModel.m
//  VmiSJ
//
//  Created by 汪的一声就哭了！ on 2017/1/17.
//  Copyright © 2017年 汪的一声就哭了！. All rights reserved.
//

#import "SHRWModel.h"

@implementation SHRWModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"message"]) {
        NSArray *array = (NSArray *)value;
        NSMutableArray *bigArr = [NSMutableArray array];
        for (NSInteger i = 0; i<array.count; i++) {
            if (i%2==0) {
                NSString *str = [NSString stringWithFormat:@"%@：%@",array[i],array[i+1]];
                [bigArr addObject:str];
            }
        }
        self.t_message = bigArr;
    }
    if ([key isEqualToString:@"phone"]) {
        
        NSString *str = (NSString *)value;
        if (str.length > 7) {
            str = [str stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
            self.user_phone = str;
        } else {
            self.user_phone = value;
        }
    }
}
- (id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}

@end
